package cn.com.connext.scrm.repository.master;

import cn.com.connext.scrm.domain.master.MerchantNotifyDetails;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description:
 * @author: ZHaoYul
 * @date: 2021/9/14 16:13
 */
@Repository
public interface MerchantRollNotifyRepository extends JpaRepository<MerchantNotifyDetails, String> , JpaSpecificationExecutor {
    @Query(value = "select * from wx_bs_notify_info  where code = :code", nativeQuery = true)
    MerchantNotifyDetails getNotifyObjByCode(@Param("code") String code);
    @Query(value = "select * from wx_bs_notify_info  where stock_id = :stock_id", nativeQuery = true)
    List<MerchantNotifyDetails> getNotifyObjByStockId(@Param("stock_id")String stock_id);
    @Query(value = "select * from wx_bs_notify_info  where stock_id = :stock_id and to_days(send_time) =TO_DAYS(NOW()) ", nativeQuery = true)
    List<MerchantNotifyDetails> getNotifyObjByStockIdDay(@Param("stock_id")String stock_id);
}
